package shapes;
import java.util.Random;


public abstract class Shapes {
	
	protected static Random random = new Random(); 
	private static int idGenerator = 0; 
	
	// Id of a shape, abscissa and ordinate.
	private int id;
	private int x;
	private int y;
	
	protected Shapes() {
		this.x = random.nextInt(100)+1;
		this.y = random.nextInt(100)+1;
		this.id = this.genid();
	}
	
	protected Shapes(int x, int y){
		this();
		this.x = x;
		this.y = y;
	}
	
	public int getID(){
		return this.id;
	}
	
	public int getX(){
		return this.x;
	}
	
	public int getY(){
		return this.y;
	}
	
	public abstract void draw();
	
	public abstract Shapes createShape();
	
	public void move(int dX, int dY){
		this.x += dX;
		this.y += dY;
	}
	
	// Generates id for shapes.
	private int genid(){
			return ++idGenerator;
	}
	
}
